package com.singfan.core.dao.database.impl;

import com.singfan.common.db.DaoBaseGeneric;
import com.singfan.common.db.DbContext;
import com.singfan.common.db.config.Table;
import com.singfan.core.dao.database.IBarberAdditionalDao;
import com.singfan.core.dao.database.model.BarberAdditional;
import org.springframework.stereotype.Repository;

/**
 *
 * Author: hansonghe
 * Date: 2015-08-19 12:12
 * Desc:
 */
@Repository
public class BarberAdditionalDaoImpl extends DaoBaseGeneric<BarberAdditional> implements IBarberAdditionalDao {
    @Override
    protected String getTableName(Object hashKey) {
        return tableNameBase;
    }

    @Override
    protected String getDatabaseId(Object hashKey) {
        Table table = DbContext.getDbConfigProvider().getTable(tableNameBase);
        return table.getDatabaseIdList(table.getNewestVersion()).get(0);
    }
}
